<?php
require "model/kid.model.php";
session_start();
  if(isset($_SESSION['username'])){ 
  $id = $_POST["id"];
  $king = $_POST["king"];
  $explanation = $_POST["content"]; 
  $tr = kidList::changekid($king,$explanation,$id);                
  if($tr){    
    echo "<script>alert('修改成功');parent.location.href='control_kid.php';</script>";
  }
  else{
    echo "<script>alert('修改失败');parent.location.href='./changekid.php?id=$id';</script>";
  }
}else{
   header("Location:../login.php");
   exit();
}

